from django.conf.urls import url, include
from rest_framework import routers
from comicinfo.views import ComicInfoViewSet, ComicKindViewSet, index, single, \
    lists, test, show_comic, ComicView


router = routers.DefaultRouter()
router.register('comicinfo', ComicInfoViewSet)
router.register('comickind', ComicKindViewSet)

urlpatterns = [
    url(r'^index', index, name='comic_index'),
    url(r'^', include(router.urls)),
    url(r'^list/kind(?P<pk>\d*)/(?P<pnum>\d*)', lists, name='list'),
    url(r'^test', test),
    url(r'^single/(.+)$', single, name='comic_single'),

    url(r'^comic/(?P<chapter_id>.+)/show(?P<pnum>\d*)', ComicView.as_view())
]
